package indigo.collections
{
	import indigo;
	import indigo.utils.IDisposable;
	import indigo.utils.IParser;

	import flash.events.Event;
	
	use namespace indigo;
	
	/**
	 * Container for keeping track of items in a LinkedList collection. Don't instantiate this class
	 * directly 
	 * @author Sebastiaan Holtrop
	 */	
	public class LinkedListItem implements IDisposable, IParser
	{
		internal var next:LinkedListItem;
		internal var previous:LinkedListItem;
		
		private var _data:*;
		
		/**
		 * Constructor. Don't instantiate this class directly 
		 * @param data
		 */
		public function LinkedListItem( data:* )
		{
			this.parseData( data );
		}
		
		
		public function parseData( data:* ):void
		{
			_data = data;	
		}
		
		
		public function get data():*
		{
			return _data;
		}

		
		public function set data( value:* ):void
		{
			_data = value;
		}
		
		
		public function dispose ( event:Event = null ):void
		{
			next = null;
			previous = null;
			_data = null;
		}
	}
}